POV-Ray : Newsgroups : povray.newusers : While Loop Help : While Loop Help Server Time
2 Nov 2024 17:21:33 EDT (-0400)
  While Loop Help  
From: Brent G
Date: 18 Oct 2003 23:03:01
Message: <3f91fee5$1@news.povray.org>
This is what I'm trying to get:

object { MyGrass1 translate <-42.5,0,46.9> } 

object { MyGrass2 translate <-37.5,0,46.9> }
object { MyGrass1 translate <-32.5,0,46.9> }
object { MyGrass2 translate <-27.5,0,46.9> }
object { MyGrass1 translate <-22.5,0,46.9> }
object { MyGrass2 translate <-17.5,0,46.9> }
object { MyGrass1 translate <-12.5,0,46.9> }
object { MyGrass2 translate <12.5,0,46.9> }
object { MyGrass1 translate <17.5,0,46.9> }
object { MyGrass2 translate <22.5,0,46.9> }
object { MyGrass1 translate <27.5,0,46.9> }
object { MyGrass2 translate <32.5,0,46.9> }
object { MyGrass1 translate <37.5,0,46.9> } 

object { MyGrass2 translate <42.5,0,46.9> }

object { MyGrass2 translate <-42.5,0,51.9> } 

object { MyGrass1 translate <-37.5,0,51.9> }
object { MyGrass2 translate <-32.5,0,51.9> }
object { MyGrass1 translate <-27.5,0,51.9> }
object { MyGrass2 translate <-22.5,0,51.9> }
object { MyGrass1 translate <-17.5,0,51.9> }
object { MyGrass2 translate <-12.5,0,51.9> }
object { MyGrass1 translate <12.5,0,51.9> }
object { MyGrass2 translate <17.5,0,51.9> }
object { MyGrass1 translate <22.5,0,51.9> }
object { MyGrass2 translate <27.5,0,51.9> }
object { MyGrass1 translate <32.5,0,51.9> }
object { MyGrass2 translate <37.5,0,51.9> } 

object { MyGrass1 translate <42.5,0,51.9> }

Except I can't figure out how to get the stupid while loops to create a 
checkerboard shape :-/ This is what I've gotten so far (the MyGrass 
Objects are both 5x5 shapes):

#declare X = 0;
#while (X <= 5)

         #declare Z = 0;
         #while(Z <= 6)

                 object { MyGrass1 translate <-12.5-(X*5),0,1.9+(Z*5)> }
                 object { MyGrass1 translate <12.5+(X*10),0,1.9+(Z*5)>  }

                 #declare Z = Z + 2;
         #end

         #declare X = X + 2;
#end

Any help would be GREATLY appreciated :-/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.